import React from 'react'
import {Link} from "react-router-dom"
import "./goods.css"
 function Goods(props) {
     let {news,reqCartadd}=props
    return (
        <div > 
            <div>新人专享</div>
            <div className="clear home_goods">
               
                {news.map((item)=>(
                    <Link className="box" to="/index/shop" key={item.id} >
                        {/* <div>id:{item.id}</div> */}
                        <img src={item.img} alt="" />
                        <div>{item.goodsname}</div>
                        <div>price:{item.price}</div>
                        {/* <div>market_price:{item.market_price}</div> */}
                        <button onClick={()=>reqCartadd(item.id)}>加购</button>
                    </Link>
                    
                ))}
            </div>
             
        </div>
    )
}
export default React.memo(Goods);